<?php

class Children {
    
    public static function find($arr){
        global $db;
        
        if($arr['nanny']){
            $st = $db->prepare('SELECT id, nom, prenom FROM CHILDREN');                    
        } else {
            throw new Exception('Unsupported property !');
        }
        
        $st->execute($arr);
        
        return $st->fetchAll(PDO::FETCH_CLASS, 'CHILDREN');
        
    }
    
}

?>
